<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>单选框 radio v-model双向绑定 </title>
</head>
<body>
    <script src="/js/vue.js"></script>
    <div id ="app">
        <!-- input标签 type是radio-->
        <!-- 当单选框被选中的时候，v-model绑定的数据属性的值被设置为单选框的value值-->
       <label for="male">
            <input type="radio" id="male" value="男" v-model="gender">男
       </label>
       <label for="female">
        <input type="radio" id="female"  value="女"  v-model="gender">女
   </label>
   <br>
   {{gender}}
    </div>
    
    <script>
       let app =new Vue({
         el:"#app",
         data:{
           gender:'男' //从后台设置默认值
         }
       })
    </script>  
</body>
</html>